import { FormInstance } from 'element-plus'

export const useForm = () => {
  const resetForm = (formRef: FormInstance) => {
    if (!formRef) return
    formRef.resetFields()
  }

  const validate = async (formRef: FormInstance) => {
    if (!formRef) return
    //验证参数
    await formRef.validate()
  }

  return { resetForm, validate }
}
